using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Data;
using Ricciolo.PaperBoy.Feeds;

namespace Ricciolo.PaperBoy.UI.Converters
{
    public class FeedCollectionToListConverter : IValueConverter
    {
        #region IValueConverter Members

        object IValueConverter.Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if ((value is FeedBaseCollection))
                return new FeedListCollectionView(((FeedBaseCollection) value));

            throw new ArgumentException("Only FeedBaseCollection permitted", "value");
        }

        object IValueConverter.ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
